var fs = require('fs');
var path = require('path');
var postcss = require('postcss');
var postcssPxToViewport = require(path.join(__dirname, '../lib'));
var css = fs.readFileSync(__dirname + '/main.css', 'utf8');

var processedCss = postcss(
  postcssPxToViewport({
    viewportWidth: 1920,
    mediaQuery: true,
  }),
).process(css).css;

fs.writeFile('main-viewport.css', processedCss, function(err) {
  if (err) {
    throw err;
  }
  console.log('File with viewport units written.');
});
